import request from '@/utils/request';
import {AxiosPromise} from 'axios';
import {RepoCompHaasVersionPageResult, RepoCompQueryParam,} from './types';
import {CreateRepoCompRequestVO} from "@/api/cloud/repository/repocomp/haas/types";

export function listRepoCompVersionEntityPages(queryParams: RepoCompQueryParam): AxiosPromise<RepoCompHaasVersionPageResult> {
    return request({
        url: '/manager/repository/component/haas/version/page',
        method: 'post',
        data: queryParams,
    });
}

export function updateRepoCompVersionEntity(data: CreateRepoCompRequestVO) {
    return request({
        url: '/manager/repository/component/haas/version/entity',
        method: 'put',
        data: data,
    });
}

export function deleteRepoCompVersionEntity(data: CreateRepoCompRequestVO) {
    return request({
        url: '/manager/repository/component/haas/version/entity',
        method: 'delete',
        params: {
            id: data.id,
        },
    });
}
